import type { Ebook, EbookList, EbookPage, EbookPageParams } from "@/types/ebook";
import { request } from "@/utils/request";

// 查询所有电子书列表
export const all = (category2Id?: number) =>
  request<EbookList>("/ebook/all", "GET", { category2Id });
// 分页查询电子书列表
export const list = (params: EbookPageParams) => request<EbookPage>("/ebook/list", "GET", params);
// 编辑/新增
export const save = (ebook: Ebook) => request("/ebook/save", "POST", ebook);
// 根据id删除
export const del = (id: number) => request(`/ebook/del/${id}`, "DELETE");
